<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<p><span></span>秒后跳转网页</p> 
	<input type="button" value="开始" id="start">
	<input type="button" value="停止" id="stop">
	<script src="../JQuery/jquery-1.11.1.js"></script>
	<script>
		var i = 5
		$("span").text(i)
		function reday(){
			i--;
			if (i==0) {
				location.href="http://baidu .com";
			}else if(i<0){
				i=0
			}
			$("span").text(i);
		}
		var app =setInterval(reday,1000);
		$("#stop").click(function(){
			app = clearInterval(app);
		})
		$("#start").click(function(){
			app = setInterval(reday,1000)
		})
	</script>
</body>
</html>